﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.CMS263.DAO;
using Com.CMS263.PO;

namespace Com.CMS263.BLL
{
    public  class BrandBLL:BaseBLL<Brand >
    {
        BrandDAO dao = new BrandDAO();
        public Brand entity = new Brand();
        public override Brand GetModel()
        {
            return entity;
        }

        #region 得到最大排序值
        /// <summary>
        /// 得到最大排序值
        /// </summary>
        /// <returns></returns>
        public int GetOrderMax()
        {
            return dao.GetOrderMax();
        }
        #endregion

        public IList<Brand> FindAll()
        {
            return dao.FindAll();
        }

        #region 读取品牌列表
        /// <summary>
        /// 读取品牌列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public IList<Brand> GetBrandList(int page, int pagesize)
        {
            return dao.GetBrandList(page, pagesize);
        }
        #endregion
        
        #region 品牌列表总数
        /// <summary>
        /// 品牌列表总数
        /// </summary>
        /// <returns></returns>
        public int GetCount()
        {
            return dao.GetCount();
        }
        #endregion

         #region 批量删除
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public int DelBrand(string ids)
        {
            return dao.DelBrand(ids);
        }
        #endregion

         #region 删除
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="orederid">删除的id</param>
        /// <returns></returns>
        public bool Delete(int orederid)
        {
            return dao.Delete(orederid);
        }
        #endregion

         #region 根据id查询实体
        /// <summary>
        /// 根据id查询实体
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Brand GetBrandById(int id)
        {
            return dao.GetBrandById(id);
        }
        #endregion

         #region 模糊查询list
        /// <summary>
        /// 模糊查询list
        /// </summary>
        /// <param name="like">查询条件</param>
        /// <param name="page"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public IList<Brand> GetBrandByLike(string like, int page, int pagesize)
        {
            return dao.GetBrandByLike(like, page, pagesize);
        }
        #endregion

         #region 模糊查询条数
        /// <summary>
        /// 模糊查询条数
        /// </summary>
        /// <param name="like"></param>
        /// <returns></returns>
        public int GerBrandByLike(string like)
        {
            return dao.GerBrandByLike(like);
        }
       #endregion

    }
}
